package com.hisky.auth.dao;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;

import com.hisky.auth.vo.Admin;
import com.hisky.basic.dao.BaseDao;

@Repository
public class AdminDao extends BaseDao {
	private static Logger logger = Logger.getLogger(AdminDao.class);

	public int add(Admin admin) {
		sqlSession.insert("Admin.add", admin);
		logger.debug("add success..." + admin);
		return admin.getAdminId();
	}

	public Admin get(Admin admin) {
		admin = sqlSession.selectOne("Admin.get", admin);
		logger.debug("get success..." + admin);
		return admin;
	}

	public int update(Admin admin) {
		int count = sqlSession.update("Admin.update", admin);
		logger.debug("update success..." + count);
		return count;
	}

	public int delete(Integer adminId) {
		int count = sqlSession.delete("Admin.delete", adminId);
		logger.debug("delete success..." + count);
		return count;
	}
}
